package com.example.management.mapper;

import com.example.management.pojo.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper {
    @Select("select * from student")
    List<Student> getAllStudent();

    @Select("select * from student where number=#{number}")
    Student selectByNumber(Long number);

    List<Student> selectByMajorAndClasses(Student student);

    List<Student> selectByDormitoryNum(Integer dormitoryNumber);

    //动态修改学生的信息（除了学号之外）
    void changeStudent(Student student);

    @Delete("delete from student where number=#{number}")
    void deleteStudent(@Param("number") Long number);

    void addStudent(Student student);


}
